//
// Created by summerday on 2021/6/5.
//

#ifndef C_PROJECT_QUEUE_H
#define C_PROJECT_QUEUE_H
#define MAX_SIZE 10
#include "linked_stack.h"
/**
 * 循环队列
 */
typedef struct {
    int data[MAX_SIZE];
    int front, rear;
    int size;
}SqQueue;

void initQueue(SqQueue &q);
bool full(SqQueue q);
bool enq(SqQueue &q, int x);
bool deq(SqQueue &q, int &x);
bool empty(SqQueue q);
bool getHead(SqQueue q, int &x);

typedef struct LinkQueueNode{
    int data;
    struct LinkQueueNode *next;
}LinkQueueNode;

/**
 * 链式队列
 */
typedef struct {

    LinkQueueNode *front, *rear;

}LinkQueue;

void initQueue(LinkQueue &q);
bool full(LinkQueue q);
void enq(LinkQueue &q, int x);
bool deq(LinkQueue &q, int &x);
bool empty(LinkQueue q);
bool getHead(LinkQueue q, int &x);

#endif //C_PROJECT_QUEUE_H
